//
//  LGHeartChartReportView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/5/24.
//  心电图报告

#import "LGHeartChartReportView.h"

#define leftMargin       viewPix(16)
#define titleWidth       30
#define lineHeight       20
#define contentWidth1    (Screen_W-viewPix(32)-viewPix(16)-titleWidth*4)/4.0
#define contentWidth2    (Screen_W-viewPix(32)-viewPix(16)-titleWidth*3)/3.0

@interface LGHeartChartReportView()

/**  二维及M型测值 */
@property (nonatomic , strong)UILabel *titleLabel1;
/**   */
@property (nonatomic , strong)UILabel *lvTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *lvContentLabel;
/**   */
@property (nonatomic , strong)UILabel *laTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *laContentLabel;
/**   */
@property (nonatomic , strong)UILabel *rvTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *rvContentLabel;
/**   */
@property (nonatomic , strong)UILabel *raTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *raContentLabel;
/**   */
@property (nonatomic , strong)UILabel *ivsTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *ivsContentLabel;
/**   */
@property (nonatomic , strong)UILabel *lvpwTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *lvpwContentLabel;
/**   */
@property (nonatomic , strong)UILabel *aoTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *aoContentLabel;
/**   */
@property (nonatomic , strong)UILabel *aaoTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *aaoContentLabel;
/**   */
@property (nonatomic , strong)UILabel *mpaTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *mpaContentLabel;


/**  多普勒测值 */
@property (nonatomic , strong)UILabel *titleLabel2;
/**   */
@property (nonatomic , strong)UILabel *e1TitleLabel;
/**   */
@property (nonatomic , strong)UILabel *e1ContentLabel;
/**   */
@property (nonatomic , strong)UILabel *e2TitleLabel;
/**   */
@property (nonatomic , strong)UILabel *e2ContentLabel;
/**   */
@property (nonatomic , strong)UILabel *avTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *avContentLabel;
/**   */
@property (nonatomic , strong)UILabel *pvTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *pvContentLabel;
/**   */
@property (nonatomic , strong)UILabel *eeTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *eeContentLabel;
/**   */
@property (nonatomic , strong)UILabel *aaTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *aaContentLabel;
/**   */
@property (nonatomic , strong)UILabel *eeeTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *eeeContentLabel;


/**  心功能 */
@property (nonatomic , strong)UILabel *titleLabel3;
/**   */
@property (nonatomic , strong)UILabel *eddTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *eddContentLabel;
/**   */
@property (nonatomic , strong)UILabel *esdTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *esdContentLabel;
/**   */
@property (nonatomic , strong)UILabel *edvTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *edvContentLabel;
/**   */
@property (nonatomic , strong)UILabel *esvTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *esvContentLabel;
/**   */
@property (nonatomic , strong)UILabel *svTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *svContentLabel;
/**   */
@property (nonatomic , strong)UILabel *efTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *efContentLabel;
/**   */
@property (nonatomic , strong)UILabel *fsTitleLabel;
/**   */
@property (nonatomic , strong)UILabel *fsContentLabel;

@end

@implementation LGHeartChartReportView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    self.lvContentLabel.attributedText = [self attributString:dataDic[@"d_lv"] unit:@""];
    self.laContentLabel.attributedText = [self attributString:dataDic[@"d_la"] unit:@""];
    self.rvContentLabel.attributedText = [self attributString:dataDic[@"d_rv"] unit:@""];
    self.raContentLabel.attributedText = [self attributString:dataDic[@"d_ra"] unit:@""];
    self.ivsContentLabel.attributedText = [self attributString:dataDic[@"d_ivs"] unit:@""];
    self.lvpwContentLabel.attributedText = [self attributString:dataDic[@"d_lvpw"] unit:@""];
    self.aoContentLabel.attributedText = [self attributString:dataDic[@"d_ao"] unit:@""];
    self.aaoContentLabel.attributedText = [self attributString:dataDic[@"d_aao"] unit:@""];
    self.mpaContentLabel.attributedText = [self attributString:dataDic[@"d_mpa"] unit:@""];
    self.e1ContentLabel.attributedText = [self attributString:dataDic[@"d_e1"] unit:@""];
    self.e2ContentLabel.attributedText = [self attributString:dataDic[@"d_e2"] unit:@""];
    self.avContentLabel.attributedText = [self attributString:dataDic[@"d_av"] unit:@""];
    self.pvContentLabel.attributedText = [self attributString:dataDic[@"d_pv"] unit:@""];
    self.eeContentLabel.attributedText = [self attributString:dataDic[@"d_e3"] unit:@"cm/s"];
    self.aaContentLabel.attributedText = [self attributString:dataDic[@"d_a1"] unit:@"cm/s"];
    self.eeeContentLabel.attributedText = [self attributString:dataDic[@"d_ee"] unit:@""];
    self.eddContentLabel.attributedText = [self attributString:dataDic[@"d_edd"] unit:@"mm"];
    self.esdContentLabel.attributedText = [self attributString:dataDic[@"d_esd"] unit:@"mm"];
    self.edvContentLabel.attributedText = [self attributString:dataDic[@"d_edv"] unit:@"ml"];
    self.esvContentLabel.attributedText = [self attributString:dataDic[@"d_esv"] unit:@"ml"];
    self.svContentLabel.attributedText = [self attributString:dataDic[@"d_sv"] unit:@"ml"];
    self.efContentLabel.attributedText = [self attributString:dataDic[@"d_ef"] unit:@"%"];
    self.fsContentLabel.attributedText = [self attributString:dataDic[@"d_fs"] unit:@"%"];
}

-(void)setDataDic2:(NSDictionary *)dataDic2{
    _dataDic2 = dataDic2;
    self.lvContentLabel.attributedText = [self attributString2:dataDic2[@"lv_value"] unit:@"" arrow:dataDic2[@"lv_arrow"]];
    self.laContentLabel.attributedText = [self attributString2:dataDic2[@"la_value"] unit:@"" arrow:dataDic2[@"la_arrow"]];
    self.rvContentLabel.attributedText = [self attributString2:dataDic2[@"rv_value"] unit:@"" arrow:dataDic2[@"rv_arrow"]];
    self.raContentLabel.attributedText = [self attributString2:dataDic2[@"ra_value"] unit:@"" arrow:dataDic2[@"ra_arrow"]];
    self.ivsContentLabel.attributedText = [self attributString2:dataDic2[@"ivs_value"] unit:@"" arrow:dataDic2[@"ivs_arrow"]];
    self.lvpwContentLabel.attributedText = [self attributString2:dataDic2[@"lvpw_value"] unit:@"" arrow:dataDic2[@"lvpw_arrow"]];
    self.aoContentLabel.attributedText = [self attributString2:dataDic2[@"ao_value"] unit:@"" arrow:dataDic2[@"ao_arrow"]];
    self.aaoContentLabel.attributedText = [self attributString2:dataDic2[@"aao_value"] unit:@"" arrow:dataDic2[@"aao_arrow"]];
    self.mpaContentLabel.attributedText = [self attributString2:dataDic2[@"mpa_value"] unit:@"" arrow:dataDic2[@"mpa_arrow"]];
    self.e1ContentLabel.attributedText = [self attributString2:dataDic2[@"e_value"] unit:@"" arrow:dataDic2[@"e_arrow"]];
    self.e2ContentLabel.attributedText = [self attributString2:dataDic2[@"a_value"] unit:@"" arrow:dataDic2[@"a_arrow"]];
    self.avContentLabel.attributedText = [self attributString2:dataDic2[@"av_value"] unit:@"" arrow:dataDic2[@"av_arrow"]];
    self.pvContentLabel.attributedText = [self attributString2:dataDic2[@"pv_value"] unit:@"" arrow:dataDic2[@"pv_arrow"]];
    self.eeContentLabel.attributedText = [self attributString2:dataDic2[@"e1_value"] unit:@"cm/s" arrow:dataDic2[@"e1_arrow"]];
    self.aaContentLabel.attributedText = [self attributString2:dataDic2[@"a1_value"] unit:@"cm/s" arrow:dataDic2[@"a1_arrow"]];
    self.eeeContentLabel.attributedText = [self attributString2:dataDic2[@"ee1_value"] unit:@"" arrow:dataDic2[@"ee1_arrow"]];
    self.eddContentLabel.attributedText = [self attributString2:dataDic2[@"edd_value"] unit:@"mm" arrow:dataDic2[@"edd_arrow"]];
    self.esdContentLabel.attributedText = [self attributString2:dataDic2[@"esd_value"] unit:@"mm" arrow:dataDic2[@"esd_arrow"]];
    self.edvContentLabel.attributedText = [self attributString2:dataDic2[@"edv_value"] unit:@"ml" arrow:dataDic2[@"edv_arrow"]];
    self.esvContentLabel.attributedText = [self attributString2:dataDic2[@"esv_value"] unit:@"ml" arrow:dataDic2[@"esv_arrow"]];
    self.svContentLabel.attributedText = [self attributString2:dataDic2[@"sv_value"] unit:@"ml" arrow:dataDic2[@"sv_arrow"]];
    self.efContentLabel.attributedText = [self attributString2:dataDic2[@"ef_value"] unit:@"%" arrow:dataDic2[@"ef_arrow"]];
    self.fsContentLabel.attributedText = [self attributString2:dataDic2[@"fs_value"] unit:@"%" arrow:dataDic2[@"fs_arrow"]];
}

-(NSMutableAttributedString *)attributString:(NSDictionary *)tempDic unit:(NSString *)unit {
    if(unit.length>0){
        NSString *content = [NSString stringWithFormat:@"%@ %@ %@",tempDic[@"result"],unit,tempDic[@"status"]];
        NSMutableAttributedString *attString = [[NSMutableAttributedString alloc]initWithString:content];
        [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithString:@"#999999"],NSFontAttributeName:LGFont(13)} range:NSMakeRange([tempDic[@"result"] length]+1, unit.length)];
        [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithString:@"#FF9704"]} range:NSMakeRange((content.length-[tempDic[@"status"] length]), [tempDic[@"status"] length])];
        return attString;
    }else{
        NSString *content = [NSString stringWithFormat:@"%@ %@",tempDic[@"result"],tempDic[@"status"]];
        NSMutableAttributedString *attString = [[NSMutableAttributedString alloc]initWithString:content];
        [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithString:@"#FF9704"]} range:NSMakeRange([tempDic[@"result"] length], [tempDic[@"status"] length])];
        return attString;
    }
}

-(NSMutableAttributedString *)attributString2:(NSString *)content unit:(NSString *)unit arrow:(NSString *)arrow{
    if(arrow.length>0){
        content = (content.length == 0)?@" ":content;
        content = [NSString stringWithFormat:@"%@ %@ %@",content,unit,arrow];
        NSMutableAttributedString *attString = [[NSMutableAttributedString alloc]initWithString:content];
        [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithString:@"#DB453A"]} range:NSMakeRange(0, content.length)];
        return attString;
    }else{
        content = (content.length == 0)?@" ":content;
        content = [NSString stringWithFormat:@"%@ %@",content,unit];
        NSMutableAttributedString *attString = [[NSMutableAttributedString alloc]initWithString:content];
        [attString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithString:@"#999999"],NSFontAttributeName:LGFont(13)} range:NSMakeRange(content.length-unit.length, unit.length)];
        return attString;
    }
}


#pragma mark
#pragma mark ====> 创建控件
-(void)createSubView{
    [self addSubview:self.titleLabel1];
    [self addSubview:self.lvTitleLabel];
    [self addSubview:self.lvContentLabel];
    [self addSubview:self.laTitleLabel];
    [self addSubview:self.laContentLabel];
    [self addSubview:self.rvTitleLabel];
    [self addSubview:self.rvContentLabel];
    [self addSubview:self.raTitleLabel];
    [self addSubview:self.raContentLabel];
    [self addSubview:self.ivsTitleLabel];
    [self addSubview:self.ivsContentLabel];
    [self addSubview:self.lvpwTitleLabel];
    [self addSubview:self.lvpwContentLabel];
    [self addSubview:self.aoTitleLabel];
    [self addSubview:self.aoContentLabel];
    [self addSubview:self.aaoTitleLabel];
    [self addSubview:self.aaoContentLabel];
    [self addSubview:self.mpaTitleLabel];
    [self addSubview:self.mpaContentLabel];
    
    [self addSubview:self.titleLabel2];
    [self addSubview:self.e1TitleLabel];
    [self addSubview:self.e1ContentLabel];
    [self addSubview:self.e2TitleLabel];
    [self addSubview:self.e2ContentLabel];
    [self addSubview:self.avTitleLabel];
    [self addSubview:self.avContentLabel];
    [self addSubview:self.pvTitleLabel];
    [self addSubview:self.pvContentLabel];
    [self addSubview:self.eeTitleLabel];
    [self addSubview:self.eeContentLabel];
    [self addSubview:self.aaTitleLabel];
    [self addSubview:self.aaContentLabel];
    [self addSubview:self.eeeTitleLabel];
    [self addSubview:self.eeeContentLabel];
    
    [self addSubview:self.titleLabel3];
    [self addSubview:self.eddTitleLabel];
    [self addSubview:self.eddContentLabel];
    [self addSubview:self.esdTitleLabel];
    [self addSubview:self.esdContentLabel];
    [self addSubview:self.edvTitleLabel];
    [self addSubview:self.edvContentLabel];
    [self addSubview:self.esvTitleLabel];
    [self addSubview:self.esvContentLabel];
    [self addSubview:self.svTitleLabel];
    [self addSubview:self.svContentLabel];
    [self addSubview:self.efTitleLabel];
    [self addSubview:self.efContentLabel];
    [self addSubview:self.fsTitleLabel];
    [self addSubview:self.fsContentLabel];
}
-(UILabel *)titleLabel1{
    if(!_titleLabel1){
        _titleLabel1 = [UILabel lableWithText:@"二维及M型测值(径线mm，面积cm3)：" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _titleLabel1.frame = CGRectMake(viewPix(16), viewPix(5), Screen_W-viewPix(64), 20);
    }
    return _titleLabel1;
}

-(UILabel *)lvTitleLabel{
    if(!_lvTitleLabel){
        _lvTitleLabel = [UILabel lableWithText:@"LV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _lvTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.titleLabel1.frame)+12, titleWidth, lineHeight);
    }
    return _lvTitleLabel;
}

-(UILabel *)lvContentLabel{
    if(!_lvContentLabel){
        _lvContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _lvContentLabel.frame = CGRectMake(kMaxX(self.lvTitleLabel.frame), kMinY(self.lvTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _lvContentLabel;
}


-(UILabel *)laTitleLabel{
    if(!_laTitleLabel){
        _laTitleLabel = [UILabel lableWithText:@"LA" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _laTitleLabel.frame = CGRectMake(kMaxX(self.lvContentLabel.frame), kMinY(self.lvTitleLabel.frame), titleWidth+10, lineHeight);
    }
    return _laTitleLabel;
}

-(UILabel *)laContentLabel{
    if(!_laContentLabel){
        _laContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _laContentLabel.frame = CGRectMake(kMaxX(self.laTitleLabel.frame), kMinY(self.lvTitleLabel.frame), contentWidth1-10, lineHeight);
    }
    return _laContentLabel;
}

-(UILabel *)rvTitleLabel{
    if(!_rvTitleLabel){
        _rvTitleLabel = [UILabel lableWithText:@"RV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _rvTitleLabel.frame = CGRectMake(kMaxX(self.laContentLabel.frame), kMinY(self.lvTitleLabel.frame), titleWidth, lineHeight);
    }
    return _rvTitleLabel;
}

-(UILabel *)rvContentLabel{
    if(!_rvContentLabel){
        _rvContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _rvContentLabel.frame = CGRectMake(kMaxX(self.rvTitleLabel.frame), kMinY(self.lvTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _rvContentLabel;
}

-(UILabel *)raTitleLabel{
    if(!_raTitleLabel){
        _raTitleLabel = [UILabel lableWithText:@"RA" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _raTitleLabel.frame = CGRectMake(kMaxX(self.rvContentLabel.frame), kMinY(self.lvTitleLabel.frame), titleWidth, lineHeight);
    }
    return _raTitleLabel;
}

-(UILabel *)raContentLabel{
    if(!_raContentLabel){
        _raContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _raContentLabel.frame = CGRectMake(kMaxX(self.raTitleLabel.frame), kMinY(self.lvTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _raContentLabel;
}

-(UILabel *)ivsTitleLabel{
    if(!_ivsTitleLabel){
        _ivsTitleLabel = [UILabel lableWithText:@"IVS" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _ivsTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.lvTitleLabel.frame)+12, titleWidth, lineHeight);
    }
    return _ivsTitleLabel;
}

-(UILabel *)ivsContentLabel{
    if(!_ivsContentLabel){
        _ivsContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _ivsContentLabel.frame = CGRectMake(kMaxX(self.ivsTitleLabel.frame), kMinY(self.ivsTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _ivsContentLabel;
}

-(UILabel *)lvpwTitleLabel{
    if(!_lvpwTitleLabel){
        _lvpwTitleLabel = [UILabel lableWithText:@"LVPW" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _lvpwTitleLabel.frame = CGRectMake(kMaxX(self.ivsContentLabel.frame), kMinY(self.ivsTitleLabel.frame), titleWidth+10, lineHeight);
    }
    return _lvpwTitleLabel;
}

-(UILabel *)lvpwContentLabel{
    if(!_lvpwContentLabel){
        _lvpwContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _lvpwContentLabel.frame = CGRectMake(kMaxX(self.lvpwTitleLabel.frame), kMinY(self.ivsTitleLabel.frame), contentWidth1-10, lineHeight);
    }
    return _lvpwContentLabel;
}

-(UILabel *)aoTitleLabel{
    if(!_aoTitleLabel){
        _aoTitleLabel = [UILabel lableWithText:@"AO" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _aoTitleLabel.frame = CGRectMake(kMaxX(self.lvpwContentLabel.frame), kMinY(self.ivsTitleLabel.frame), titleWidth, lineHeight);
    }
    return _aoTitleLabel;
}

-(UILabel *)aoContentLabel{
    if(!_aoContentLabel){
        _aoContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _aoContentLabel.frame = CGRectMake(kMaxX(self.aoTitleLabel.frame), kMinY(self.ivsTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _aoContentLabel;
}

-(UILabel *)aaoTitleLabel{
    if(!_aaoTitleLabel){
        _aaoTitleLabel = [UILabel lableWithText:@"AAO" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _aaoTitleLabel.frame = CGRectMake(kMaxX(self.aoContentLabel.frame), kMinY(self.ivsTitleLabel.frame), titleWidth, lineHeight);
    }
    return _aaoTitleLabel;
}

-(UILabel *)aaoContentLabel{
    if(!_aaoContentLabel){
        _aaoContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _aaoContentLabel.frame = CGRectMake(kMaxX(self.aaoTitleLabel.frame), kMinY(self.ivsTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _aaoContentLabel;
}

-(UILabel *)mpaTitleLabel{
    if(!_mpaTitleLabel){
        _mpaTitleLabel = [UILabel lableWithText:@"MPA" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _mpaTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.ivsTitleLabel.frame)+12, titleWidth, lineHeight);
    }
    return _mpaTitleLabel;
}

-(UILabel *)mpaContentLabel{
    if(!_mpaContentLabel){
        _mpaContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _mpaContentLabel.frame = CGRectMake(kMaxX(self.mpaTitleLabel.frame), kMinY(self.mpaTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _mpaContentLabel;
}



////

-(UILabel *)titleLabel2{
    if(!_titleLabel2){
        _titleLabel2 = [UILabel lableWithText:@"多普勒测值(速度m/s，压差mmHg):" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _titleLabel2.frame = CGRectMake(viewPix(16), kMaxY(self.titleLabel1.frame)+106, Screen_W-viewPix(64), 20);
    }
    return _titleLabel2;
}


-(UILabel *)e1TitleLabel{
    if(!_e1TitleLabel){
        _e1TitleLabel = [UILabel lableWithText:@"E" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _e1TitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.titleLabel2.frame)+12, titleWidth, lineHeight);
    }
    return _e1TitleLabel;
}

-(UILabel *)e1ContentLabel{
    if(!_e1ContentLabel){
        _e1ContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _e1ContentLabel.frame = CGRectMake(kMaxX(self.e1TitleLabel.frame), kMinY(self.e1TitleLabel.frame), contentWidth1, lineHeight);
    }
    return _e1ContentLabel;
}


-(UILabel *)e2TitleLabel{
    if(!_e2TitleLabel){
        _e2TitleLabel = [UILabel lableWithText:@"A" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _e2TitleLabel.frame = CGRectMake(kMaxX(self.e1ContentLabel.frame), kMinY(self.e1TitleLabel.frame), titleWidth, lineHeight);
    }
    return _e2TitleLabel;
}

-(UILabel *)e2ContentLabel{
    if(!_e2ContentLabel){
        _e2ContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _e2ContentLabel.frame = CGRectMake(kMaxX(self.e2TitleLabel.frame), kMinY(self.e1TitleLabel.frame), contentWidth1, lineHeight);
    }
    return _e2ContentLabel;
}

-(UILabel *)avTitleLabel{
    if(!_avTitleLabel){
        _avTitleLabel = [UILabel lableWithText:@"AV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _avTitleLabel.frame = CGRectMake(kMaxX(self.e2ContentLabel.frame), kMinY(self.e1TitleLabel.frame), titleWidth, lineHeight);
    }
    return _avTitleLabel;
}

-(UILabel *)avContentLabel{
    if(!_avContentLabel){
        _avContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _avContentLabel.frame = CGRectMake(kMaxX(self.avTitleLabel.frame), kMinY(self.e1TitleLabel.frame), contentWidth1, lineHeight);
    }
    return _avContentLabel;
}

-(UILabel *)pvTitleLabel{
    if(!_pvTitleLabel){
        _pvTitleLabel = [UILabel lableWithText:@"PV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _pvTitleLabel.frame = CGRectMake(kMaxX(self.avContentLabel.frame), kMinY(self.e1TitleLabel.frame), titleWidth, lineHeight);
    }
    return _pvTitleLabel;
}

-(UILabel *)pvContentLabel{
    if(!_pvContentLabel){
        _pvContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _pvContentLabel.frame = CGRectMake(kMaxX(self.pvTitleLabel.frame), kMinY(self.e1TitleLabel.frame), contentWidth1, lineHeight);
    }
    return _pvContentLabel;
}

-(UILabel *)eeTitleLabel{
    if(!_eeTitleLabel){
        _eeTitleLabel = [UILabel lableWithText:@"e’" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _eeTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.e1TitleLabel.frame)+12, titleWidth, lineHeight);
    }
    return _eeTitleLabel;
}

-(UILabel *)eeContentLabel{
    if(!_eeContentLabel){
        _eeContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _eeContentLabel.frame = CGRectMake(kMaxX(self.eeTitleLabel.frame), kMinY(self.eeTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _eeContentLabel;
}

-(UILabel *)aaTitleLabel{
    if(!_aaTitleLabel){
        _aaTitleLabel = [UILabel lableWithText:@"a’" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _aaTitleLabel.frame = CGRectMake(kMaxX(self.eeContentLabel.frame), kMinY(self.eeTitleLabel.frame), titleWidth, lineHeight);
    }
    return _aaTitleLabel;
}

-(UILabel *)aaContentLabel{
    if(!_aaContentLabel){
        _aaContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _aaContentLabel.frame = CGRectMake(kMaxX(self.aaTitleLabel.frame), kMinY(self.eeTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _aaContentLabel;
}

-(UILabel *)eeeTitleLabel{
    if(!_eeeTitleLabel){
        _eeeTitleLabel = [UILabel lableWithText:@"E/e’" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _eeeTitleLabel.frame = CGRectMake(kMaxX(self.aaContentLabel.frame), kMinY(self.eeTitleLabel.frame), titleWidth, lineHeight);
    }
    return _eeeTitleLabel;
}

-(UILabel *)eeeContentLabel{
    if(!_eeeContentLabel){
        _eeeContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _eeeContentLabel.frame = CGRectMake(kMaxX(self.eeeTitleLabel.frame), kMinY(self.eeTitleLabel.frame), contentWidth1, lineHeight);
    }
    return _eeeContentLabel;
}




//////
-(UILabel *)titleLabel3{
    if(!_titleLabel3){
        _titleLabel3 = [UILabel lableWithText:@"心功能：" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _titleLabel3.frame = CGRectMake(viewPix(16), kMaxY(self.titleLabel2.frame)+76, Screen_W-viewPix(64), 20);
    }
    return _titleLabel3;
}


-(UILabel *)eddTitleLabel{
    if(!_eddTitleLabel){
        _eddTitleLabel = [UILabel lableWithText:@"EDD" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _eddTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.titleLabel3.frame)+12, titleWidth, lineHeight);
    }
    return _eddTitleLabel;
}

-(UILabel *)eddContentLabel{
    if(!_eddContentLabel){
        _eddContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _eddContentLabel.frame = CGRectMake(kMaxX(self.eddTitleLabel.frame), kMinY(self.eddTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _eddContentLabel;
}

-(UILabel *)esdTitleLabel{
    if(!_esdTitleLabel){
        _esdTitleLabel = [UILabel lableWithText:@"ESD" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _esdTitleLabel.frame = CGRectMake(kMaxX(self.eddContentLabel.frame), kMinY(self.eddTitleLabel.frame), titleWidth, lineHeight);
    }
    return _esdTitleLabel;
}

-(UILabel *)esdContentLabel{
    if(!_esdContentLabel){
        _esdContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _esdContentLabel.frame = CGRectMake(kMaxX(self.esdTitleLabel.frame), kMinY(self.eddTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _esdContentLabel;
}

-(UILabel *)edvTitleLabel{
    if(!_edvTitleLabel){
        _edvTitleLabel = [UILabel lableWithText:@"EDV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _edvTitleLabel.frame = CGRectMake(kMaxX(self.esdContentLabel.frame), kMinY(self.eddTitleLabel.frame), titleWidth, lineHeight);
    }
    return _edvTitleLabel;
}

-(UILabel *)edvContentLabel{
    if(!_edvContentLabel){
        _edvContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _edvContentLabel.frame = CGRectMake(kMaxX(self.edvTitleLabel.frame), kMinY(self.eddTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _edvContentLabel;
}

-(UILabel *)esvTitleLabel{
    if(!_esvTitleLabel){
        _esvTitleLabel = [UILabel lableWithText:@"ESV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _esvTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.eddTitleLabel.frame)+12, titleWidth, lineHeight);
    }
    return _esvTitleLabel;
}

-(UILabel *)esvContentLabel{
    if(!_esvContentLabel){
        _esvContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _esvContentLabel.frame = CGRectMake(kMaxX(self.esvTitleLabel.frame), kMinY(self.esvTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _esvContentLabel;
}

-(UILabel *)svTitleLabel{
    if(!_svTitleLabel){
        _svTitleLabel = [UILabel lableWithText:@"SV" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _svTitleLabel.frame = CGRectMake(kMaxX(self.esvContentLabel.frame), kMinY(self.esvTitleLabel.frame), titleWidth, lineHeight);
    }
    return _svTitleLabel;
}

-(UILabel *)svContentLabel{
    if(!_svContentLabel){
        _svContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _svContentLabel.frame = CGRectMake(kMaxX(self.svTitleLabel.frame), kMinY(self.esvTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _svContentLabel;
}

-(UILabel *)efTitleLabel{
    if(!_efTitleLabel){
        _efTitleLabel = [UILabel lableWithText:@"EF" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _efTitleLabel.frame = CGRectMake(kMaxX(self.svContentLabel.frame), kMinY(self.esvTitleLabel.frame), titleWidth, lineHeight);
    }
    return _efTitleLabel;
}

-(UILabel *)efContentLabel{
    if(!_efContentLabel){
        _efContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _efContentLabel.frame = CGRectMake(kMaxX(self.efTitleLabel.frame), kMinY(self.esvTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _efContentLabel;
}

-(UILabel *)fsTitleLabel{
    if(!_fsTitleLabel){
        _fsTitleLabel = [UILabel lableWithText:@"FS" colorString:@"#666666" textFont:LGFont(13) textAlignment:NSTextAlignmentLeft lines:1];
        _fsTitleLabel.frame = CGRectMake(viewPix(16), kMaxY(self.esvTitleLabel.frame)+12, titleWidth, lineHeight);
    }
    return _fsTitleLabel;
}

-(UILabel *)fsContentLabel{
    if(!_fsContentLabel){
        _fsContentLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFontWeight(13, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _fsContentLabel.frame = CGRectMake(kMaxX(self.fsTitleLabel.frame), kMinY(self.fsTitleLabel.frame), contentWidth2, lineHeight);
    }
    return _fsContentLabel;
}


@end
